package com.itheima.d2_thread_api;

public class ThreadTest1 {
    public static void main(String[] args) {
        MyThread t1 = new MyThread("1号线程");
        t1.start();
        System.out.println(t1.getName());

        MyThread t2 = new MyThread("2号线程");
        t2.start();
        System.out.println(t2.getName());

        Thread m = Thread.currentThread();
        m.setName("主线程");
        System.out.println(m.getName());

        for (int i = 0; i < 5; i++) {
            System.out.println(m.getName()+"线程输出"+i);
        }
    }
}

